package br.mikhas.container.annotation;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Defines a resource link to the context.
 * <p>
 * If used on a java type, this type will be defines as a context resource and
 * will be available for wiring.
 * <p>
 * If used on a attribute or method, this member will be filled with a context
 * resource.
 * 
 * @author Mikhail Domanoski
 * 
 */
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Target( { TYPE, FIELD, METHOD })
public @interface Resource {
	/**
	 * The name of the resource.
	 * <p>
	 * If it's left in blank, the container will set it's name as the simple
	 * class name.
	 * 
	 * @return The name of the resource on the context.
	 */
	String value() default "";
}
